import Cookies from 'js-cookie'

export const UIDKey = 'bagent-uid'
export const TokenKey = 'bagent-token'
export const NICKNAMEKey = 'bagent-nickname'
export const EMAILKey = 'bagent-email'
export const ROLE = 'bagent-ROLE'
export const BUSINESS = 'bagent-business'
export const ROLESELF = 'bagent-roleSelf'
export const ROLELEVEL = 'bagent-roleLevel'
export const businessName = 'bagent-businessName'
export const MenuList = 'menuList'
export const ISBACKCHOOSE = 'ISBACKCHOOSE'
const v_code = 'vcode'

export function setCookies(key, value) {
  return Cookies.set(key, value)
}

export function getCookies(key) {
  return Cookies.get(key)
}

export function setVcode(val=1) {
  return Cookies.set(v_code,val)
}

export function getVcode() {
  return Cookies.get(v_code)
}
export function removeCookies(key) {
  return Cookies.remove(key)
}
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  // document.addCookie('game_user_token=' + token)
  return Cookies.set(TokenKey, token)
}
export function removeToken() {
  return Cookies.remove(TokenKey)
}
